public class Book {
    private String title;
    private int quantity;
    private double price;

    // 有参构造器
    public Book(String title, int quantity, double price) {
        this.title = title;
        this.quantity = quantity;
        this.price = price;
    }

    // 无参构造器
    public Book() {
        this.title = "未知书名";
        this.quantity = 0;
        this.price = 0.0;
    }

    // 输出书名和剩余数量
    public void displayInfo() {
        System.out.println("书名是：" + title + "，剩余数量为" + quantity + "本");
    }

    public static void main(String[] args) {
        // 创建Book对象并初始化
        Book book = new Book("小王子", 10000, 58.6);
        // 调用displayInfo方法显示信息
        book.displayInfo();
    }
}
